var healthStatus = healthStatus||{}

healthStatus.enclosureJson=function(data,id){
		$.each(data,function(index,trObj){
			healthStatus.enclosureItem(trObj,id);
	   })
	};
healthStatus.enclosureItem=function(trObj,id){
		var oTr = "";
		if(id=='tbPb'){
			trObj.type=1;
		}
		if(id=='tbHeartBeats'){
			trObj.type=2;
		}
		if(id=='tbSteps'){
			trObj.type=3;
		}
		healthStatus.enclosureObj(trObj)
	}

healthStatus.enclosureObj=function(trObj){
		trObj.className="com-info";
		trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-info";
		if(trObj.type==1){//血压：warning：h：140-160.l：40-60 ；error：h>160||h<90||L>90||L<50
			if(!trObj.highNum){
				trObj.lowNum = trObj.num.split("~")[0];
				trObj.highNum = trObj.num.split("~")[1];
			}
			if(trObj.highNum>140||trObj.lowNum<60||trObj.lowNum>90||trObj.highNum<90){
				if(trObj.highNum>160||trObj.lowNum<40||trObj.lowNum>90||trObj.highNum<90){
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-error";
					trObj.className="danger";
				}
				else{
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-warning";
					trObj.className="warning";
				}
			}	
			 trObj.num = trObj.lowNum+"~"+trObj.highNum;
		}
		if(trObj.type==2){//心跳，error>130||<40 ;warning:100-130||40-60
			if(trObj.num>100||trObj.num<60){
				if(trObj.num>130||trObj.num<40){
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-error";
					trObj.className="danger";
				}
				else{
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-warning";
					trObj.className="warning";
				}
			}	
		}
		if(trObj.type==3){//血糖，error>150||<60 ;warning:140-150||60-70
			if(trObj.num>140||trObj.num<70){
				if(trObj.num>150||trObj.num<60){
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-error";
					trObj.className="danger";
				}
				else{
					trObj.iclassName="glyphicon glyphicon-exclamation-sign com-icon-warning";
					trObj.className="warning";
				}
			}	
		}
		return trObj;
	}